import request from '@/utils/request'

export default {
  //添加、修改相册
  saveOrUpdate(album) {
    return request({
      url: `/admin/album`,
      method: 'post',
      //把对象转换为json格式
      data: album
    })
  },
  //删除相册
  delete(id) {
    return request({
      url: `/admin/album/${id}`,
      method: 'delete',
    })
  },
  //获取相册列表(后端)
  list(current,size,keywords) {
    return request({
      url: `/admin/album`,
      method: 'get',
      params: {current,size,keywords}
    })
  },
  getAlbumInfo(){
    return request({
      url: `/admin/album/info`,
      method: 'get',
    })
  },
  //通过id获取相册(后端)
  getById(id) {
    return request({
      url: `/admin/album/${id}`,
      method: 'get',
    })
  }
}